const koa = require('./lib/application')
// const koa = require('koa')
const app = new koa()

// app.use((ctx,next)=>{
//     ctx.body = 'hello1'
//     next()
//     ctx.body = 'hello4' // 这是最后设置，返回 hello4
// })
// app.use((ctx,next)=>{
//     ctx.body = 'hello2'
//     next()
//     ctx.body = 'hello3'
// })

app.use(async (ctx,next)=>{
    ctx.body = 'hello2'
    ctx.body = 147258
    ctx.body = await require('fs/promises').readFile('./aaa.png')
    ctx.body = require('fs').createReadStream('./aaa.png')
    ctx.body = {name:'小明',age:22}
    ctx.body = null
})

app.listen(3000)
